from django.db import models


class Upload(models.Model):
    file = models.FileField(upload_to='', unique=True)

    class Meta:
        verbose_name_plural = '上传报表'
        verbose_name = verbose_name_plural

    def __str__(self):
        return self.file.name


class Report(models.Model):
    begin_month = models.DateField(blank=True, null=True)
    end_month = models.DateField(blank=True, null=True)

    class Meta:
        verbose_name_plural = '生成报告'
        verbose_name = verbose_name_plural

    def __str__(self):
        return '{} to {}'.format(self.begin_month, self.end_month)
